package com.wbs.shop.nuby.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhoucl on 2018/6/13 0013.
 */
public class GoodsBean extends BaseBean implements Parcelable {

    /**
     * agentPrice : 0.01
     * allowCopy : 0
     * createDate : 2018-03-28 16:11:17
     * goodsCode : 1
     * id : 4
     * imgDetails : ["http://image.joyshops.cn/FnBjfU2-HvJQKIGz10NcsJJYTtw0"]
     * imgUrl : http://image.joyshops.cn/FghWrgLaXz8hIFDUhP6J80w0ptN-
     * isDiscount : 1
     * isSale : 1
     * marketPrice : 1
     * name : 测试商品222
     * pinyin : cssp222
     * price : 0.03
     * quantity : 15
     * saleVolume : 0
     * sendHome : 1
     * shareCommis : 0
     * shareCommisSuper : 0
     * shopId : d8b7c273408
     * shopName : 小灰灰22
     * typeId : 20
     * typeName : AAS
     * weight : 0
     */

    private String agentPrice;
    private int allowCopy;
    private String createDate;
    private String goodsCode;
    private int id;
    private String imgDetails;
    private String imgUrl;
    private int isDiscount;
    private int isSale;
    private String marketPrice;
    private String name;
    private String pinyin;
    private String price;
    private int quantity;
    private int saleVolume;
    private int sendHome;
    private int shareCommis;
    private int shareCommisSuper;
    private String shopId;
    private String shopName;
    private int typeId;
    private String typeName;
    private int weight;
    private List<SpecBean> specList;

    public List<SpecBean> getSpecList() {
        if (specList == null) {
            return new ArrayList<>();
        }
        return specList;
    }

    public void setSpecList(List<SpecBean> specList) {
        this.specList = specList;
    }

    public String getAgentPrice() {
        return agentPrice;
    }

    public void setAgentPrice(String agentPrice) {
        this.agentPrice = agentPrice;
    }

    public int getAllowCopy() {
        return allowCopy;
    }

    public void setAllowCopy(int allowCopy) {
        this.allowCopy = allowCopy;
    }

    public String getCreateDate() {
        return createDate == null ? "" : createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getGoodsCode() {
        return goodsCode == null ? "" : goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getImgDetails() {
        return imgDetails == null ? "" : imgDetails;
    }

    public void setImgDetails(String imgDetails) {
        this.imgDetails = imgDetails;
    }

    public String getImgUrl() {
        return imgUrl == null ? "" : imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public int getIsDiscount() {
        return isDiscount;
    }

    public void setIsDiscount(int isDiscount) {
        this.isDiscount = isDiscount;
    }

    public int getIsSale() {
        return isSale;
    }

    public void setIsSale(int isSale) {
        this.isSale = isSale;
    }

    public String getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(String marketPrice) {
        this.marketPrice = marketPrice;
    }

    public String getName() {
        return name == null ? "" : name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPinyin() {
        return pinyin == null ? "" : pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public int getSaleVolume() {
        return saleVolume;
    }

    public void setSaleVolume(int saleVolume) {
        this.saleVolume = saleVolume;
    }

    public int getSendHome() {
        return sendHome;
    }

    public void setSendHome(int sendHome) {
        this.sendHome = sendHome;
    }

    public int getShareCommis() {
        return shareCommis;
    }

    public void setShareCommis(int shareCommis) {
        this.shareCommis = shareCommis;
    }

    public int getShareCommisSuper() {
        return shareCommisSuper;
    }

    public void setShareCommisSuper(int shareCommisSuper) {
        this.shareCommisSuper = shareCommisSuper;
    }

    public String getShopId() {
        return shopId == null ? "" : shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName == null ? "" : shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName == null ? "" : typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public GoodsBean() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.agentPrice);
        dest.writeInt(this.allowCopy);
        dest.writeString(this.createDate);
        dest.writeString(this.goodsCode);
        dest.writeInt(this.id);
        dest.writeString(this.imgDetails);
        dest.writeString(this.imgUrl);
        dest.writeInt(this.isDiscount);
        dest.writeInt(this.isSale);
        dest.writeString(this.marketPrice);
        dest.writeString(this.name);
        dest.writeString(this.pinyin);
        dest.writeString(this.price);
        dest.writeInt(this.quantity);
        dest.writeInt(this.saleVolume);
        dest.writeInt(this.sendHome);
        dest.writeInt(this.shareCommis);
        dest.writeInt(this.shareCommisSuper);
        dest.writeString(this.shopId);
        dest.writeString(this.shopName);
        dest.writeInt(this.typeId);
        dest.writeString(this.typeName);
        dest.writeInt(this.weight);
        dest.writeTypedList(this.specList);
    }

    protected GoodsBean(Parcel in) {
        this.agentPrice = in.readString();
        this.allowCopy = in.readInt();
        this.createDate = in.readString();
        this.goodsCode = in.readString();
        this.id = in.readInt();
        this.imgDetails = in.readString();
        this.imgUrl = in.readString();
        this.isDiscount = in.readInt();
        this.isSale = in.readInt();
        this.marketPrice = in.readString();
        this.name = in.readString();
        this.pinyin = in.readString();
        this.price = in.readString();
        this.quantity = in.readInt();
        this.saleVolume = in.readInt();
        this.sendHome = in.readInt();
        this.shareCommis = in.readInt();
        this.shareCommisSuper = in.readInt();
        this.shopId = in.readString();
        this.shopName = in.readString();
        this.typeId = in.readInt();
        this.typeName = in.readString();
        this.weight = in.readInt();
        this.specList = in.createTypedArrayList(SpecBean.CREATOR);
    }

    public static final Creator<GoodsBean> CREATOR = new Creator<GoodsBean>() {
        @Override
        public GoodsBean createFromParcel(Parcel source) {
            return new GoodsBean(source);
        }

        @Override
        public GoodsBean[] newArray(int size) {
            return new GoodsBean[size];
        }
    };
}
